package com.ruoyi.service.impl;


import com.ruoyi.service.IVideoService;
import org.springframework.stereotype.Service;

import java.io.File;

@Service
public class VideoServiceImpl implements IVideoService {
    @Override
    public File getVideoByAddress(String address) {
        File video = new File(address);
        if(!video.exists()||!video.isFile()){
            throw  new IllegalArgumentException("视频不存在");
        }
        return video;
    }

    /**
     * 根据屏幕id查找视频
     * @param id 屏幕id
     * @return 地址
     */
    @Override
    public String getAddressByScreenId(Integer id) {
        return "./1.mp4";
    }
}
